Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
Changing date format from "Jun 02, 2022 at 05:55 AM CDT" to "06/02/2022 at 05:55 AM"

I need to change a date format from "Jun 02, 2022 at 05:55 AM CDT" to "06/02/2022 at 05:55 AM". I tried many date conversions, but I am not getting the result I want.

order.messageSentOn = new Intl.DateTimeFormat('en-US').format(dbDate);

Any help is appreciated. Thank you.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Install moment

yarn add moment
// Or
npm i moment

Uses

import moment from "moment"

// ......

const date= "Jun 02, 2022 at 05:55 AM";

const formatedDate = moment(date).format("MM/DD/YYYY HH:mm A")

Your code

const tempData= data.map((order) => {
          order.messageSentOn = moment(order.messageSentOn).format("MM/DD/YYYY HH:mm A");
    return order;
        });
        setDocumentsTable(tempData);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!